<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./wangEditor/wangEditor.js"></script>
</head>

<body>

    <head>
        <style>
            .toolbar {
                border: 1px solid #ccc;
            }

            .text {
                border: 1px solid #ccc;
                min-height: 400px;
            }
        </style>
    </head>

    <body>

        <div>
            <div id="toolbar-container" class="toolbar"></div>
            <div id="text-container" class="text"></div>
        </div>
        <button>
            获取内容
        </button>
        <!-- 引入 wangEditor.min.js -->
        <script>
            const E = window.wangEditor
            const editor = new E('#toolbar-container', '#text-container') // 传入两个元素
            editor.create()

            document.querySelector("button").onclick = function () {
                console.log(editor.txt.html());
            }
        </script>

    </body>
</body>

</html>